package org.example.vo;

import lombok.Data;

@Data
public class ResultVo<T> {
    private Integer code = 200;
    private T data;
    private String msg;
    public ResultVo<T> success(T data) {
        this.data = data;
        this.code = 200;
        return this;
    }
    public ResultVo<T> voidSuccess() {
        this.code = 200;
        return this;
    }

    public ResultVo<T> error(int code, String msg) {
        this.code = code;
        this.msg = msg;
        return this;
    }
}
